<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
		xmlns:h="http://java.sun.com/jsf/html"  
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich">  
    
    <h:body>
        <rich:dataTable value="#{cartSession.invoices}" var="invoice" rows="0" rowClasses="odd-row, even-row" style="width: 100%;">
            <f:facet name="header">
                <rich:columnGroup>
                    <rich:column>
                        <h:outputText value="Titre" />
                    </rich:column>
                    <rich:column>
                        <h:outputText value="Quantité" />
                    </rich:column>
                    <rich:column>
                        <h:outputText value="Prix unitaire" />
                    </rich:column>
                    <rich:column>
                        <h:outputText value="Sous-total" />
                    </rich:column>
                </rich:columnGroup>
            </f:facet>

            <rich:column>
                <h:outputText value="#{invoice.book.title}" />
            </rich:column>
            <rich:column>
                <h:outputText value="#{invoice.quantity}" />
            </rich:column>
            <rich:column>
                <h:outputText value="#{invoice.book.price} €" />
            </rich:column>
            <rich:column>
                <h:outputText value="#{invoice.book.price * invoice.quantity} €" />
            </rich:column>

            <f:facet name="footer">
                <rich:columnGroup>
                    <rich:column colspan="3"></rich:column>
                    <rich:column colspan="1">Prix total :&nbsp;&nbsp;<h:outputText value="#{cartSession.totalPrice} €" styleClass="label"></h:outputText></rich:column>
                </rich:columnGroup>
            </f:facet>
        </rich:dataTable>
    </h:body>
</html>

